package day03.`match`

import scala.util.Random

object CaseClassDemo {
  def main(args: Array[String]): Unit = {
    val arr = Array(CheckTimeOutTask, SubmitTask("10000", "task-00001"), HeartBeat(3000))
    arr(Random.nextInt(arr.length)) match {
      case CheckTimeOutTask => println("CheckTimeOutTask")
      case HeartBeat(a) => println("HeartBeat")
      case SubmitTask(x, y) => println("SubmitTask")
    }
  }
}

case class HeartBeat(time: Long)

case class SubmitTask(id: String, taskName: String)

case object CheckTimeOutTask